<cfcomponent extends="mof.Core">
	
	<cfscript>
       this.name = REReplaceNoCase(ExpandPath("."), "[^0-9a-z]","","all");
       this.applicationTimeout = CreateTimeSpan(1,0,0,0);
       this.clientmanagement= false;
       this.sessionmanagement = true;
       this.sessiontimeout = CreateTimeSpan(0,1,0,0);
       this.setClientCookies = true;
       this.setDomainCookies = true;  
	</cfscript>
   


	<cffunction name="onRequestStart">
		<cfargument name="requestname" required="true" />
		
		<cfif structKeyExists(url,"reinit") AND url.reinit EQ "complete" AND StructKeyExists(application,"ApplicationName")>
			<cfset reloadFramework() />
		</cfif>				
		
		<cfset runFramework() />
		<cfreturn />   
	</cffunction>
   
   
   <cffunction name="onError" output="true">
       <cfargument name="exception" required=true/>
       <cfargument name="eventName" type="String" required=true/>
       <!--- Log all errors. --->
	  <cfdump var="#arguments#">
      <cfdump var="#this#">
	  <cfdump var="#application#">
	  <cfdump var="#request#">
	  <cfabort>
      
       <!--- Display an error message if there is a page context. --->
       <cfif (trim(arguments.eventName) IS NOT "onSessionEnd") AND (trim(arguments.eventName) IS NOT "onApplicationEnd")>
            <cflog file="#this.name#" type="error"
                text="Event name: #arguments.eventName#" >
            <cflog file="#this.name#" type="error"
                text="Message: #arguments.exception.message#">
	            <cfoutput>
	                <h2>An unexpected error occurred.</h2>
	                <p>Please provide the following information to technical support:</p>
	                <p>Error Event: #arguments.eventName#</p>
	                <p>Error details:</p>
	            </cfoutput>   
	            <cfdump var="#arguments.exception#">	

         <cfelseif (arguments.eventName IS "onApplicationEnd")>
               <cflog file="#this.name#" type="Information"
            text="Application #this.name# Ended" >
		</cfif>
	</cffunction>

</cfcomponent>

